package segmentTree;

public class SegmentTest {
    public static void main(String[] args) {
        Integer arr[] = {-1, 0, 2, 3, 7, -4, 10};
        SegmentTree<Integer> segTree = new SegmentTree<Integer>(arr, new Merger<Integer>() {
            @Override
            public Integer merge(Integer a, Integer b) {
                return a + b;
            }
        });

        System.out.println(segTree);
        System.out.println(segTree.query(4,6));

        segTree.set(5,4);
        System.out.println(segTree);
        System.out.println(segTree.query(4,6));


    }
}
